<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_mailing_list" action="<?php echo url_for('mailing_list/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_mailing_list='.$form->getObject()->getIdMailingList() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_mailing_list" value="<?php echo $form->getObject()->getIdMailingList() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <tr><th colspan="2" class="title">Dados mailing_list</th></tr>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['ds_nome_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_nome_list'] ?>
          <?php echo form_error('mailing_list[ds_nome_list]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_email_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_email_list'] ?>
          <?php echo form_error('mailing_list[ds_email_list]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['id_mailing_group']->renderLabel() ?></th>
        <td>
          <?php echo $form['id_mailing_group'] ?>
          <?php include_component('mailing_group', 'botaoAdicionar'); ?>
          <?php echo form_error('mailing_list[id_mailing_group]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['st_mailing_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['st_mailing_list'] ?>
          <?php echo form_error('mailing_list[st_mailing_list]'); ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<?php
	comandos_form(
		link_to(
			':: Listar ::',
			'mailing_list/list',
			array('class' => 'botao')
		),
		button_to_function(
			':: Salvar ::',
			"$('#form_mailing_list').submit()",
			array('class' => 'botao')
		)
	);
?>